<?php
/**
 * @Author: rocky
 * Date: 2019/12/11
 * Time: 14:30
 */


namespace app\shop\resource;


use app\common\resource\BaseResource;
use app\shop\model\ShopGoodsSpec;

class SeckillGoodResoure extends BaseResource
{
    public function toArray($data){
        $sepc = ShopGoodsSpec::where('gid',$data['id'])->where('is_deleted',0)->removeOption('order')->order('price')->find();
        return [
            'id'=>$data['id'],
            'title'=>$data['title'],
            'price'=>$data['price'],
            'seckill_price'=>$sepc['seckill_price'],
            'logo'=>$data['logo'],
        ];
    }
}